package de.Objects;

import java.awt.Shape;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.media.j3d.Alpha;
import javax.media.j3d.BranchGroup;
import javax.media.j3d.Shape3D;
import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;
import javax.vecmath.Vector3d;

import com.sun.j3d.utils.picking.PickCanvas;

public class createFigures extends BranchGroup {
	BranchGroup root = new BranchGroup();
	Alpha a = new Alpha(-1, 3000);
	public createFigures(){
		
		TransformGroup tg1;
		for(int i = 0 ; i < 9 ; i++){
			Transform3D t1 = new Transform3D();
			t1.rotY(Math.PI / -2.0f);
			t1.setScale(0.3);
			t1.setTranslation(new Vector3d(6.0f,-0.3f,i + -4.0f));
			
			tg1 = new TransformGroup(t1);
			tg1.setName("PT" + i);
			tg1.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
			tg1.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
			tg1.setCapability(TransformGroup.ENABLE_PICK_REPORTING);
			
			Schneemann s1 = new Schneemann(0);
			s1.setName("P" + i);
			s1.setUserData(t1);
			root.addChild(tg1);
			tg1.addChild(s1);
		}	
		
		for(int i = 0 ; i < 9 ; i++){
			Transform3D t1 = new Transform3D();
			t1.rotY(Math.PI / 2.0f);
			t1.setScale(0.3);
			t1.setTranslation(new Vector3d(-6.0f,-0.3f,i + -4.0f));
			
			tg1 = new TransformGroup(t1);
			tg1.setName("ST" + i);
			tg1.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
			tg1.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
			tg1.setCapability(TransformGroup.ENABLE_PICK_REPORTING);
			
			Schneemann s1 = new Schneemann(1);
			s1.setName("S" + i);
			s1.setUserData(t1);
			root.addChild(tg1);
			tg1.addChild(s1);
		}	
		super.addChild(root);		
	}
}